/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ultrasoft.farmasoft.domain;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Administrador
 */										
@Entity
@Table(name = "genericvalue")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Genericvalue.findAll", query = "SELECT g FROM Genericvalue g"),
    @NamedQuery(name = "Genericvalue.findByGenericValueId", query = "SELECT g FROM Genericvalue g WHERE g.genericValueId = :genericValueId"),
    @NamedQuery(name = "Genericvalue.findByPharmacyId", query = "SELECT g FROM Genericvalue g WHERE g.pharmacyId = :pharmacyId"),
    @NamedQuery(name = "Genericvalue.findByPharmacyIdByGroup", query = "SELECT g FROM Genericvalue g WHERE g.pharmacyId = :pharmacyId AND g.group = :group"),
    @NamedQuery(name = "Genericvalue.findByGroup", query = "SELECT g FROM Genericvalue g WHERE g.group = :group"),
    @NamedQuery(name = "Genericvalue.findByDescription", query = "SELECT g FROM Genericvalue g WHERE g.description = :description"),
    @NamedQuery(name = "Genericvalue.findByInitials", query = "SELECT g FROM Genericvalue g WHERE g.initials = :initials"),
    @NamedQuery(name = "Genericvalue.findByOrder", query = "SELECT g FROM Genericvalue g WHERE g.order = :order")})
public class Genericvalue implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "genericValueId")
    private Integer genericValueId;
    @Column(name = "pharmacyId")
    private Integer pharmacyId;
	@Basic(optional = false)
    @Column(name = "group")
    private short group;
    @Basic(optional = false)
    @Column(name = "description")
    private String description;
    @Column(name = "initials")
    private String initials;
    @Column(name = "order")
    private Short order;

    public Genericvalue() {
    }

    public Genericvalue(Integer genericValueId) {
        this.genericValueId = genericValueId;
    }

    public Genericvalue(Integer genericValueId, short group, String description) {
        this.genericValueId = genericValueId;
        this.group = group;
        this.description = description;
    }

    public Integer getGenericValueId() {
        return genericValueId;
    }

    public Integer getPharmacyId() {
		return pharmacyId;
	}

	public void setPharmacyId(Integer pharmacyId) {
		this.pharmacyId = pharmacyId;
	}
    
    public void setGenericValueId(Integer genericValueId) {
        this.genericValueId = genericValueId;
    }

    public short getGroup() {
        return group;
    }

    public void setGroup(short group) {
        this.group = group;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getInitials() {
        return initials;
    }

    public void setInitials(String initials) {
        this.initials = initials;
    }

    public Short getOrder() {
        return order;
    }

    public void setOrder(Short order) {
        this.order = order;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (genericValueId != null ? genericValueId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Genericvalue)) {
            return false;
        }
        Genericvalue other = (Genericvalue) object;
        if ((this.genericValueId == null && other.genericValueId != null) || (this.genericValueId != null && !this.genericValueId.equals(other.genericValueId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ultrasoft.farmasoft.domain.Genericvalue[ genericValueId=" + genericValueId + " ]";
    }
    
}
